package com.doit.demo95;

import java.util.ArrayList;
import java.util.Collections;
import java.util.stream.Stream;

//两个集合 六个男演员 六个女演员
/*
    男演员之只要名字为三个字的前三个人
    女演员只要姓林的 并且不要第一个
    合并
     实例化一个Actor对象,用map,遍历数组
 */
public class test02 {
    public static void main(String[] args) {
        ArrayList<String>manArray = new ArrayList<>();
        Collections.addAll(manArray,"刘德华","成龙","吴彦祖","周润发","周星驰","吴京");
        ArrayList<String>womanArray = new ArrayList<>();
        Collections.addAll(womanArray,"林心如","孙俪","柳岩","林青霞","王祖贤","张曼玉");

        Stream<String> stream1 = manArray.stream().filter(s -> s.length() == 3).limit(3);
        Stream<String> stream2 = womanArray.stream().filter(s -> s.startsWith("林")).skip(1);

        Stream<String> concat = Stream.concat(stream1, stream2);

        concat.map(s->new Actor(s)).forEach(s-> System.out.println(s));
    }
}
